package com.loto.insurance.oem.web.service;

import java.util.ArrayList;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.loto.insurance.oem.web.db.mapper.ProductInfoMapper;
import com.loto.insurance.oem.web.entity.ProductInfo;

@Service
public class ProductInfoService {

  @Autowired
  ProductInfoMapper productInfoMapper;

  public ArrayList<ProductInfo> findAllOrdersByCust(Map<String, Object> params) {
	ArrayList<ProductInfo> orderList = productInfoMapper
	    .findAllProductByTypePager(params);
	return orderList;
  }

  public long findAllOrdersByCustCount(Map<String, Object> params) {
	return productInfoMapper.findAllProductByTypePagerCount(params);
  }

  public ProductInfo findProductById(Map<String, Object> params) {
	return productInfoMapper.findProductById(params);
  }

  public long insertProduct(ProductInfo productInfo) {
	return productInfoMapper.insertProduct(productInfo);
  }

  public int updateProduct(ProductInfo productInfo) {
	return productInfoMapper.updateProduct(productInfo);
  }

  public int deleteProduct(long productId) {
	return productInfoMapper.deleteProduct(productId);
  }
}
